package com.szholly.pro.watergas_server.ps.data;

import java.util.HashMap;

import com.szholly.data.general.metadata.table.DefulatDomainTable;
import org.springframework.stereotype.Component;

import com.szholly.data.general.Field;
import com.szholly.data.general.InterceptorTableBase;
import com.szholly.data.general.metadata.IBaseTable;
import com.szholly.utils.spring.SpringBeanFactory;
import org.springframework.stereotype.Component;
import com.szholly.data.general.GlobalDataType;
import com.szholly.data.general.RowBase;


/**
 * MonitorDataHour
 */
@Component("MonitorDataHour")
public class MonitorDataHourTable extends InterceptorTableBase  implements IBaseTable{

	public final static String TABLE_NAME = "MONITOR_DATA";
	
	/**
	 * single ref
	 */
	public static MonitorDataHourTable getSingleRef() {
		return (MonitorDataHourTable) SpringBeanFactory.getBean("MonitorDataHour");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "MonitorDataHour";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = null;
			
			itemField = new Field();
			itemField.setFieldName(MonitorDataHourRow.FIELD_Flag);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(16);
			itemField.setFieldAliasName("数据标识");
			itemField.setAllowNull(true);
			itemField.setCodeTablePK(DefulatDomainTable.TABLE_NAME);
			itemField.setCodeDomainName("数据标识");
			itemField.setMaxLen(10);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName("DATA_FROM");
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(16);
			itemField.setFieldAliasName("监测数据来源");
			itemField.setAllowNull(true);
			itemField.setCodeTablePK(DefulatDomainTable.TABLE_NAME);
			itemField.setCodeDomainName("监测数据来源");
			itemField.setMaxLen(10);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "MonitorDataHour";
	}
}